package com.trendit.print.sdk.models.printer;

import com.alibaba.fastjson.JSON;
import com.trendit.print.sdk.DaquObject;
import com.trendit.print.sdk.DaquRequest;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 修改打印名称
 */
public class EditPrinterRequest implements DaquRequest<EditPrinterResponse> {

    private String bizContent;

    /**
     * 构造方法
     */
    public EditPrinterRequest(List<EditPrinterRequest.Model> models) {
        this.bizContent = JSON.toJSONString(models);
    }

    @Override
    public String getApiMethodName() {
        return "openapi.editPrinter";
    }

    @Override
    public String getApiVersion() {
        return "1.0";
    }

    @Override
    public String getNotifyUrl() {
        return null;
    }

    @Override
    public String getApiMethodURL() {
        return "/openapi/update_printer";
    }

    @Override
    public Class<EditPrinterResponse> getResponseClass() {
        return EditPrinterResponse.class;
    }

    @Override
    public DaquObject getBizModel() {
        return null;
    }

    @Override
    public String getBizContent() {
        return bizContent;
    }

    @Data
    public static class Model extends DaquObject {
        /**
         * 设备编码
         */
        @NotNull
        private String sn;

        /**
         * 设备名称
         */
        @NotNull
        private String name;

        @Min(1)
        @Max(16)
        private Integer lang = 16;


    }
}
